import iViewTheme from 'iview-layout-themes'
const axios = iViewTheme.util.apiRequest
// 文章管理列表分页
export const getArticleListPage = (data) => {
  return axios.request({
    url: 'wl/site/getArticleListPage',
    data: data,
    type: 'post',
    php: true
  })
}
// 获取文章名字列表
export const getArticleNameList = () => {
  return axios.request({
    url: 'wl/site/getArticleNameList',
    type: 'get',
    php: true
  })
}
// 编辑文章
export const getArticleDetails = (data) => {
  return axios.request({
    url: 'wl/site/getArticleDetails',
    data: { id: data },
    type: 'post',
    php: true
  })
}
// 添加文章
export const addArticle = (data) => {
  return axios.request({
    url: 'wl/site/addArticle',
    data: data,
    type: 'post',
    php: true
  })
}
// 修改文章
export const updateArticle = (data) => {
  return axios.request({
    url: 'wl/site/updateArticle',
    data: data,
    type: 'post',
    php: true
  })
}
// 删除文章
export const deleteArticle = (data) => {
  return axios.request({
    url: 'wl/site/deleteArticle',
    data: data,
    type: 'post',
    php: true
  })
}
// 批量删除
export const deleteData = (data) => {
  return axios.request({
    url: 'wl/site/deleteData',
    data: data,
    type: 'post',
    php: true
  })
}
// 获取文章分类列表
export const getCategoryList = (data) => {
  return axios.request({
    url: 'wl/site/getCategoryList',
    data: data,
    type: 'post',
    php: true
  })
}
// 获取文章分类名称列表
export const getCategoryNameList = () => {
  return axios.request({
    url: 'wl/site/getCategoryNameList',
    type: 'get',
    php: true
  })
}
// 通过id获取分类列表
export const getCategoryById = (data) => {
  return axios.request({
    url: 'wl/site/getCategoryById',
    data: { id: data },
    type: 'post',
    php: true
  })
}
// 添加分类
export const addCategory = (data) => {
  return axios.request({
    url: 'wl/site/addCategory',
    data: data,
    type: 'post',
    php: true
  })
}
// 单条删除分类
export const deleteCategory = (data) => {
  return axios.request({
    url: 'wl/site/deleteCategory',
    data: data,
    type: 'post',
    php: true
  })
}
// 批量删除分类
export const deleteCategoryStrips = (data) => {
  return axios.request({
    url: 'wl/site/deleteCategoryStrips',
    data: data,
    type: 'post',
    php: true
  })
}
// 保存接口
export const editCategory = (data) => {
  return axios.request({
    url: 'wl/site/editCategory',
    data: data,
    type: 'post',
    php: true
  })
}
/**
 * 管理端
 */
// 数据导入
export const importData = (data) => {
  return axios.request({
    url: 'wl/site/importData',
    data: data,
    type: 'post',
    php: true
  })
}
// 数据列表
export const getDataTableListPage = (data) => {
  return axios.request({
    url: 'wl/site/getDataTableListPage',
    data: data,
    type: 'post',
    php: true
  })
}
// 数据列表-删除
export const deleteDataTable = (data) => {
  return axios.request({
    url: 'wl/site/deleteDataTable',
    data: data,
    type: 'post',
    php: true
  })
}
// 数据列表-批量删除
export const deleteAllDataTable = (data) => {
  return axios.request({
    url: 'wl/site/deleteAllDataTable',
    data: data,
    type: 'post',
    php: true
  })
}
